const storageManager = require('../storage');

/**
 * API接口列表资源
 */
module.exports = {
  name: 'api-endpoints',
  description: '当前项目的API接口列表',
  handler: async () => {
    try {
      const apis = storageManager.getApis();
      
      // 返回API接口的基本信息
      return apis.map(api => ({
        id: api.id,
        path: api.path,
        method: api.method,
        description: api.description,
        auth: api.auth,
        tags: api.tags,
        createdAt: api.createdAt,
        updatedAt: api.updatedAt
      }));
    } catch (error) {
      return {
        error: error.message
      };
    }
  }
}; 